<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="layui/css/layui.css"  media="all">
</head>
<body>
<form class="layui-form" id="forms">
	<div class="layui-form-item" hidden="hidden">
			<label class="layui-form-label">ID:</label>
			<div class="layui-input-inline" style="width: 350px;">
				<input type="text" id="id" name="id" required
					lay-verify="required" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label"><span style="color: red;">*</span>
				用户名</label>
			<div class="layui-input-inline">
				<input type="text" name="name" id="name" required lay-verify="required"
					placeholder="请输入" autocomplete="off" class="layui-input">
			</div>
		</div>	
		<div class="layui-btn-container" style="text-align: center;">
			<input type="submit" class="layui-btn" lay-filter="userEditBtu" id="sub" value="修改"/>
		</div>
	</form>
</body>
<script src="js/User.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="layui/layui.js"></script>
	<script>
		layui.use('form', function() {
			var form = layui.form;
			var $ = layui.jquery; 
			$("#sub").click(function(){
				var data=$("#forms").serialize();
				var url =globalData.server+ 'roles/updateRoles';
				$.post(url, data, function(data) {
					if (data.count > 0) {
						console.log('修改成功');
						var index = parent.layer.getFrameIndex(window.name); 
						parent.layer.close(index);
					}
				}, "json");
				return false;
			});
		});
	</script>
</html>